package cc.mrbird.demo.controller;

import cc.mrbird.demo.exception.UserNotExistException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: chenhs
 * @date: Created in 20:50 2020/3/16
 **/
@RestController
@RequestMapping("user")
public class UserController {

    @GetMapping("/{id:\\d+}")
    public void get(@PathVariable String id) {
//        throw new RuntimeException("user not exist " + id);
        throw new UserNotExistException(id);
    }

}
